#ifndef GUI_TOOBARMANAGER_H_H_H_H
#define GUI_TOOBARMANAGER_H_H_H_H

#include <string>
#include <QStringList>
#include <vector>

class QAction;
class QToolBar;
class ToolBarItem
{
public:
	ToolBarItem();
	ToolBarItem(ToolBarItem* item);
	~ToolBarItem();

	void setCommand(const std::string&);
	std::string command()const;

	bool hasItem()const;
	ToolBarItem* findItem(const std::string&);
	ToolBarItem*copy()const;
	int count()const;

   void appendItem(ToolBarItem* item);
   bool insertItem(ToolBarItem*,ToolBarItem*item);
   void removeItem(ToolBarItem* item);
   void clear();

   ToolBarItem& operator << (ToolBarItem* item);
   ToolBarItem& operator << (const std::string& command);

   QList<ToolBarItem*> getItems() const;

private:
	std::string _name;
	QList<ToolBarItem*> _items;

};

class ToolBarManager
{
public:
	ToolBarManager(void);
	~ToolBarManager(void);
public:

	static ToolBarManager* getIntances();
	static ToolBarManager* _instance;
	static void destruct();

	void setup(ToolBarItem*);
	void saveState()const;
	void restoreState()const;
	void retranslate()const;

protected:
	void setup(ToolBarItem*, QToolBar*)const;
	QList<QToolBar*>toolBars()const;

  QToolBar* findToolBar(const QList<QToolBar*>&, const QString&) const;
   QAction* findAction(const QList<QAction*>&, const QString&) const;

private:
	 QStringList toolbarNames;
	// static ToolBarManager* _instance;



};
#endif